// pages/ours/ours.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    userid:'',
    userinfo:{},

  },
  //客服电话
  tocall: function () {
    wx.makePhoneCall({
      phoneNumber: getApp().globalData.tile
    })
  },
  question:function(){
    wx.navigateTo({
      url: '../question/question',
    })
  },
  coupon:function(){
    wx.navigateTo({
      url: '../coupon/coupon',
    })
  },
  tixian:function(){
    wx.navigateTo({
      url: '../tixian/tixian',
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    
  },
  toset:function(){
    wx.navigateTo({
      url: '../oursSet/oursSet',
    })
  },
  tochongzhi:function(){
    console.log(33)
    wx.navigateTo({
      url: '../chongzhi/chongzhi',
    })
  },
  tochongzhilist:function(){
    wx.navigateTo({
      url: '../chongzhilist/chongzhilist',
    })
  },
  fenxiang: function () {
    wx.navigateTo({
      url: '../invite/invite',
    })
  },
  dianzan:function(){
    wx.navigateTo({
      url: '../dianzan/dianzan',
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    var that = this;
    console.log(getApp().globalData.id)
    that.setData({
      userid: getApp().globalData.id
    })

    wx.request({
      url: 'https://wukongweixiu.cn/index/Defaults/getuserinfo',
      data: {
        id: that.data.userid,
      },
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      method: 'GET',
      success: function (res) {
        console.log(res)
        that.setData({
          userinfo: res.data.data,

        })
      }
    })
  },
  toorder: function (e) {
    wx.navigateTo({
      url: '../order/order?type=' + e.currentTarget.dataset.id
    });
  },
  tofabuorder: function (e) {
    wx.navigateTo({
      url: '../fabuorder/fabuorder?type=' + e.currentTarget.dataset.id
    });
  },
  tosendorder: function (e) {
    wx.navigateTo({
      url: '../tosendorder/tosendorder'
    });
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})